package com.liuqh.tag.config.shiro;


import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;

/**
 * @Description TODO(这里用一句话描述这个类的作用)
 *
 * @author liuqinghua
 * @date 2023-7-14
 */
//@Configuration
public class FilterConfig {
    @Bean
    public FilterRegistrationBean fbsRequestFilterRegistration() {
        FilterRegistrationBean registration = new FilterRegistrationBean();
        registration.setFilter(new TokenFilter());
        // 拦截路径
        registration.addUrlPatterns("/*");
        // 拦截器名称
        registration.setName("tokenFilter");
        // 顺序
        registration.setOrder(Ordered.HIGHEST_PRECEDENCE);
        return registration;
    }
}
